<template>
	<view>
		<view class="ptitle">秒杀车型</view>
		<scroll-view class="splist" scroll-x='true'>
			<view class="phostlist">
				<view class="p-item" v-for="p in plist" :key="p.pid">
					<navigator url="/pages/product/product">
						<image :src="$server_pic+p.ppic" mode="widthFix"></image>
						<text class="pname">{{p.pname}}</text>
						<text>￥{{p.pprice}}</text>
					</navigator>
				</view>

			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		name: "home-secKill",
		data() {
			return {
				plist: []
			};
		},
		created() {
			this.$request({
				url: '/product/secKill',
				success: (res) => {
					this.plist = res.data;
				}
			})
		}
	}
</script>

<style>
	
	.ptitle {
		line-height: 80rpx;
		font-size: 32rpx;
		padding-left: 2%;
		background-color: white;
		margin-bottom: 1px;
		border-radius: 8rpx 8rpx 0 0;
	}

	.splist {
		height: 280rpx;
	}

	.phostlist {
		display: flex;
		flex-direction: row;
	}

	.p-item {
		margin: 8rpx;
		width: 180upx;
		background-color: white;
	}

	.p-item navigator {
		display: flex;
		flex-direction: column;
		text-align: center;
	}

	.p-item image {
		width: 100%;
		display: block;
	}

	.p-item text {
		display: block;
		font-size: 22rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		box-sizing: border-box;
		width: 100%;
		line-height: 42rpx;
	}
	
	
</style>